<?php
App::uses('AppModel', 'Model');
/**
 * Anuncio Model
 *
 * @property Anunciante $Anunciante
 * @property SituacaoAnuncio $SituacaoAnuncio
 * @property User $User
 * @property Animal $Animal
 * @property Midia $Midia
 */
class Anuncio extends AppModel {

/**
 * Display field
 *
 * @var string
 */
	public $displayField = 'titulo';


	//The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * belongsTo associations
 *
 * @var array
 */
	public $belongsTo = array(
		'Anunciante' => array(
			'className' => 'Anunciante',
			'foreignKey' => 'anunciante_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'SituacaoAnuncio' => array(
			'className' => 'SituacaoAnuncio',
			'foreignKey' => 'situacao_anuncio_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'user_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Animal' => array(
			'className' => 'Animal',
			'foreignKey' => 'animal_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

/**
 * hasAndBelongsToMany associations
 *
 * @var array
 */
	public $hasAndBelongsToMany = array(
		'Midia' => array(
			'className' => 'Midia',
			'joinTable' => 'anuncios_midias',
			'foreignKey' => 'anuncio_id',
			'associationForeignKey' => 'midia_id',
			'unique' => 'keepExisting',
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
		)
	);

}
